# Maintainer: Jürgen Hötzel <juergen@archlinux.org>

pkgname=ocaml-integers
pkgver=0.5.1
pkgrel=1
pkgdesc='Library for binding to C libraries using pure OCaml'
arch=('loong64' 'x86_64')
url=https://github.com/ocamllabs/ocaml-integers
license=('custom')
options=('!strip')
makedepends=('dune' 'ocaml-topkg' 'ocaml-findlib' 'ocaml-compiler-libs>=4.12.0' 'ocamlbuild' 'opam')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ocamllabs/$pkgname/archive/$pkgver.tar.gz")
sha256sums=('f608ce98caf41ddb4eea90e8673bb8ff35acb07ef951bc0bf75b5989ef9b36b8')


build() {
  cd ${pkgname}-$pkgver
  dune build --profile release
}

package() {
  cd ${pkgname}-$pkgver

  opam-installer --prefix="${pkgdir}/usr" \
		 --libdir="${pkgdir}$(ocamlc -where)" \
		 --docdir="${pkgdir}/usr/share/doc" \
		 --stubsdir="${pkgdir}$(ocamlc -where)/stublibs" \
		 ./_build/default/integers.install
  install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}"/LICENSE.md
}
